@import "../global/global";

$loader-height: 16px;
$loader-width: 16px;

$ball-size: 5px;

$loader-center: $loader-height/2 - $ball-size/2;
$ball-delay: 0.25s;

@keyframes ball-colors {
  12.5% {
    background-color: #D73CEA;
  }
  25% {
    background-color: #9135E0;
  }
  37.5% {
    background-color: #5848F4;
  }
  50% {
    background-color: #25B7FF;
  }
  62.5% {
    background-color: #59BD00;
  }
  75% {
    background-color: #FBAC02;
  }
  87.5% {
    background-color: #E32581;
  }
  100% {
    background-color: #D73CEA;
  }
}

@keyframes ball-moves {
  0% {
    transform: rotate(0deg) translateX(-$loader-center);
  }
  100% {
    transform: rotate(360deg) translateX(-$loader-center);
  }
}

@keyframes loader-rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


.ring-loader-inline {
  display: inline-block;
  position: relative;
  width: $loader-width;
  height: $loader-height;
  transform-origin: center;
  animation: loader-rotation 2.5s linear infinite;
}

.ring-loader-inline__ball {
  position: absolute;
  top: $loader-center;
  left: $loader-center;

  width: $ball-size;
  height: $ball-size;

  background-color: #D73CEA;
  border-radius: 50%;

  animation: ball-moves 1.2s cubic-bezier(0.480, 0.200, 0.480, 0.800) infinite,
  ball-colors 3s linear infinite;

  //Forces animation to start from non-zero point
  animation-delay: -$ball-delay;

  &_second {
    opacity: 0.8;
    animation-delay: -$ball-delay*2;
  }

  &_third {
    opacity: 0.6;
    animation-delay: 0s; // Use 0s instead of initial to support IE10+
  }
}
